﻿@using e_TicaretSistemi.Models
@model e_TicaretSistemi.Models.UserCardInfo
@{
    Html.RenderPartial("ProductDetail", Model.Product);
    var currentCustomer = (Customer)Session["LoginKey"];
}

<div class="saleForm">
    @using (Html.BeginForm())
    {
        var monthList = new List<int>();
        for (var i = 1; i <= 12; i++)
        {
            monthList.Add(i);
        }
        var yearList = new List<int>();
        for (var i = 15; i < 22; i++)
        {
            yearList.Add(i);
        }

        @Html.HiddenFor(d => d.Product.Id)
        <div>
            @Html.Label("Kart Numarası: ")
            @Html.TextBoxFor(d => d.CardNumber)
            @Html.ValidationMessageFor(d => d.CardNumber)
        </div>
        <div>
            @Html.Label("CV2 No: ")
            @Html.TextBoxFor(d => d.SecurityNumber)
            @Html.ValidationMessageFor(d => d.SecurityNumber)
        </div>
        <div>
            @Html.Label("Kart Sahibinin Adı Soyadı: ")
            @Html.TextBoxFor(d => d.CardHasName)
            @Html.ValidationMessageFor(d => d.CardHasName)
        </div>
        <div>
            @Html.Label("Son Kullanma Tarihi: ")
            @Html.DropDownListFor(d => d.ExpMonth, new SelectList(monthList))
            @Html.ValidationMessageFor(d => d.ExpMonth)
            /
            @Html.DropDownListFor(d => d.ExpYear, new SelectList(yearList))
            @Html.ValidationMessageFor(d => d.ExpYear)
        </div>
        <div>
            @Html.Label("Fatura Adresi:")
            @Html.TextBox("BillAdress", currentCustomer.BillAdress)
        </div>
        <div>
            @Html.Label("Teslimat Adresi:")
            @Html.TextBox("DeliveryAdress", currentCustomer.DeliveryAdress)
        </div>
        <input type="submit" value="Satışı Tamamla" />
    }
</div>
